package com.sample.transitiondemo;

import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.transition.Explode;
import android.transition.Fade;
import android.transition.Slide;
import android.view.Gravity;
import android.view.Window;

/**
 * Created by guo
 *
 * @ 2016/10/25
 */

public class TransitionActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
//        Explode slide = new Explode();

        Slide slide = new Slide();
        slide.setDuration(1000);
        getWindow().setEnterTransition(slide);
        getWindow().setReturnTransition(slide);


        setContentView(R.layout.activity_transition);

    }


    @Override
    public void onBackPressed() {
        super.onBackPressed();
        finishAfterTransition();
    }
}
